package com.eshop.eshop2021_v1.mapper.before;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.eshop.eshop2021_v1.pojo.Address;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author: 若若叶
 * @date: 2021/10/9 9:52 FileName: AddressMapper Description:
 */
@Mapper
public interface AddressMapper extends BaseMapper<Address> {
  // 添加收获地址
  int addAddressInfo(Address address);
  // 查询当前用户的全部收获地址
  List<Address> finAllAddressInfoById(@Param("uid") Integer uid);

  // 设置非默认isDefault=1
  int setNoneDefault(Integer uid);

  // 设置默认地址
  int setDefauilAddress(@Param("aid") Integer aid, @Param("uid") Integer uid);

  // 删除一条地址
  int deleteAddress(Integer aid);
}
